<!-- Message Error -->
<?php if ($this->session->flashdata('f_designers')): ?>
    <div class="msg msg-ok boxwidth">
        <p><strong><?php echo $this->session->flashdata('f_designers'); ?></strong></p>
    </div>
<?php endif; ?>

<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>Edit Designer</h2>
    </div>
    <!-- End Box Head -->

    <form action="<?php echo base_url();?>admin/designers/edit_submit" method="post" enctype="multipart/form-data">

        <!-- Form -->
        <div class="form">
            <p>
                <label>Nick Name <span>(Required Field)</span></label>
                <input type="text" class="field size1" name="nick_name" value="<?php echo $designer->nick_name;?>"/>
                <input type="hidden" class="field size1" name="id" value="<?php echo $designer->id;?>"/>
            </p>
            <p>
                <label>Full Name <span>(Required Field)</span></label>
                <input type="text" class="field size1" name="full_name" value="<?php echo $designer->full_name;?>"/>
            </p>
            <p class="inline-field">
                <?php
                    $year = date("Y",strtotime($designer->birthdate));
                    $month = date("n",strtotime($designer->birthdate));
                    $day = date("d",strtotime($designer->birthdate));
                    $months = array("January","February","March","April","May","June","July","August","September","October","November","December");
                ?>
                <label>Birth Date <span>(Required Field)</span></label>
                <select class="field size2" name="bd_date">
                    <?php for($i=1;$i<=31;$i++):?>
                    <option value="<?php echo $i;?>" <?php echo ($day==$i)?'selected':'';?>><?php echo $i;?></option>
                    <?php endfor;?>
                </select>
                <select class="field size3" name="bd_month">
                    <?php for($i=1;$i<=12;$i++):?>
                    <option value="<?php echo $i;?>" <?php echo ($i==$month)?'selected':'';?>><?php echo $months[$i-1];?></option>
                    <?php endfor;?>
                </select>
                <select class="field size3" name="bd_year">
                    <?php for($i=1950;$i<=date("Y");$i++):?>
                    <option value="<?php echo $i;?>" <?php echo ($i==$year)?'selected':'';?>><?php echo $i;?></option>
                    <?php endfor;?>
                </select>
            </p>
            <p class="inline-field">
                <label>Nationality</label>
                <select class="field size1" name="nationality">
                    <?php foreach($nationality->result() as $n):?>
                    <option value="<?php echo $n->nationality_id;?>" <?php echo ($n->nationality_id==$designer->nationality)?'selected':'';?>><?php echo $n->nationality_title;?></option>
                    <?php endforeach;?>
                </select>
            </p>
            <p>
                <label>City <span>(Required Field)</span></label>
                <input type="text" class="field size1" name="city" value="<?php echo $designer->city;?>"/>
            </p>
            <p class="inline-field">
                <label>Gender <span>(Required Field)</span></label>
                <select class="field size2" name="gender">
                    <option value="M" <?php echo ($designer->gender=="M")?'selected':'';?>>Male</option>
                    <option value="F" <?php echo ($designer->gender=="F")?'selected':'';?>>Female</option>
                </select>
            </p>
            <p>
                <label>Main Photo</label>
                <img class="admin-designer-photo" src="<?php echo base_url();?>photo/designers/main/<?php echo $designer->main_photo;?>"/>
            </p>
            <p>
                <label>Change Main Photo <span>(Required Field)</span></label>
                <input type="file" class="field size1" name="main_photo"/>
            </p>
            <p>
                <label>Contact 1 <span>(Optional Field)</span></label>
                <input type="text" class="field size1" name="contact1" value="<?php echo $designer->contact1;?>"/>
            </p>
            <p>
                <label>Contact 2 <span>(Optional Field)</span></label>
                <input type="text" class="field size1" name="contact2" value="<?php echo $designer->contact2;?>"/>
            </p>
            <p>
                <label>Website 1 <span>(Optional Field)</span></label>
                <input type="text" class="field size1" name="website1" value="<?php echo $designer->website1;?>"/>
            </p>
            <p>
                <label>Website 2 <span>(Optional Field)</span></label>
                <input type="text" class="field size1" name="website2" value="<?php echo $designer->website2;?>"/>
            </p>
            <p>
                <label>Description <span>(Required Field)</span></label>
                <textarea class="field size1" rows="10" cols="30" name="description"><?php echo $designer->description;?></textarea>
            </p>	

        </div>
        <!-- End Form -->
        
        <!-- Form Buttons -->
        <div class="buttons">
            <input type="submit" class="button" value="submit" />
        </div>
        <!-- End Form Buttons -->
    </form>
</div>
<!-- End Box -->